package com.khyr.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.khyr.entity.OperLog;
import com.khyr.service.OperLogService;
import com.khyr.vo.OperLogVo;
import com.khyr.vo.R;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 宋一恒
 * @version 1.0
 */
@RestController
@RequestMapping(value ="/systemManager/operLog")
public class OperLogController {
    @Autowired
    private OperLogService operLogService;
    //查询操作日志
    @PostMapping("/selectOperLogByCond")
    public R<Page<OperLog>> selectOperLogByCond(@RequestBody OperLogVo operLogVo){
        return operLogService.selectOperLogByCond(operLogVo);
    }
    //删除操作日志
    @DeleteMapping("/deleteOperLogByOperLogIds/{ids}")
    public R<Integer> deleteOperLogByOperLogIds(@PathVariable List<Long> ids){
        return operLogService.deleteOperLogByOperLogIds(ids);
    }

    //清空
    @DeleteMapping("/clearOperLog")
    public R<Integer> clearOperLog(){
        return operLogService.clearOperLog();
    }
}
